/**
 * 
 */
package idv.takeshi.software.productline.bookstore.domain.model.useraccount;

import java.io.Serializable;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * A entity Key for Role model class.
 * @author takeshi
 *
 */
public class RoleKey implements Serializable {
	
	private Long userAccountId;
	
	private Integer id;

	/**
	 * @return the userAccountId
	 */
	public Long getUserAccountId() {
		return userAccountId;
	}

	/**
	 * @param userAccountId the userAccountId to set
	 */
	public void setUserAccountId(Long userAccountId) {
		this.userAccountId = userAccountId;
	}

	/**
	 * @return the id
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (obj == null) { return false; }
		   if (obj == this) { return true; }
		   if (obj.getClass() != getClass()) {
		     return false;
		   }
		   RoleKey rhs = (RoleKey) obj;
		   return new EqualsBuilder()
		       .append(this.userAccountId, rhs.userAccountId)
			   .append(this.id, rhs.id)
		       .isEquals();
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		return new HashCodeBuilder(53, 59).
		   append(this.userAccountId).
	       append(this.id).
	       toHashCode();
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
	}

}
